/*
 * @Descripttion: 数据空间接口
 * @Author: yichao yichao@ssc-hn.com
 * @Date: 2024-07-16
 * @LastEditors: yichao yichao@ssc-hn.com
 * @LastEditTime: 2024-07-16
 */
import request from '/@/api/request'

/** 资产目录分页列表 */
export const requestSpaceAssetCatalogListByPage = (data: SpaceAssetCatalogTypes.IRequest) => {
  return request.post<IPaginationResponse<SpaceAssetCatalogTypes.IResponse>>('/catalog/asset/api/getAssetCatalogList/V1', data)
}

/** 资产目录启用停用 */
export const requestSpaceSwitchCatalog = (data: SpaceSwitchCatalogTypes.IRequest) => {
  return request.post<IBaseResponse<SpaceSwitchCatalogTypes.IResponse>>('/business/asset/catalog/switchCatalog', data)
}

/** 编辑资产目录 */
export const requestEditSpaceCatalog = (data: SpaceEditCatalogTypes.IRequest) => {
  return request.post<IBaseResponse<SpaceEditCatalogTypes.IResponse>>('/catalog/asset/api/updateAssetCatalog/V1', data)
}

/** 新增资产目录 */
export const requestAddSpaceCatalog = (data: SpaceAddCatalogTypes.IRequest) => {
  return request.post<IBaseResponse<SpaceAddCatalogTypes.IResponse>>('/catalog/asset/api/addAssetCatalog/V1', data)
}
/** 删除资产目录 */
export const requestDeleteSpaceCatalog = (data: SpaceDeleteCatalogTypes.IRequest) => {
  return request.post<IBaseResponse<SpaceDeleteCatalogTypes.IResponse>>('/catalog/asset/api/deleteAssetCatalog/V1', data)
}
/** 新增目录接口 */
export const requestAddCatalogInterface = (data: SpaceAddCatalogInterfaceTypes.IRequest) => {
  return request.post<IBaseResponse<SpaceAddCatalogInterfaceTypes.IResponse>>('/catalog/asset/inter/api/addAssetCatalogInter/V1', data)
}
/** 编辑目录接口 */
export const requestEditCatalogInterface = (data: SpaceAddCatalogInterfaceTypes.IRequest) => {
  return request.post<IBaseResponse<SpaceAddCatalogInterfaceTypes.IResponse>>('/catalog/asset/inter/api/updateAssetCatalogInter/V1', data)
}
/** 目录接口列表 */
export const requestCatalogInterfaceList = (data: SpaceCatalogInterfaceListTypes.IRequest) => {
  return request.post<IBaseResponse<SpaceCatalogInterfaceListTypes.IResponse>>('/catalog/asset/inter/api/getAssetCatalogInterList/V1', data)
}
/** 删除目录接口 */
export const requestDeleteCatalogInterface = (data: SpaceDeleteCatalogInterfaceTypes.IRequest) => {
  return request.post<IBaseResponse<SpaceDeleteCatalogInterfaceTypes.IResponse>>('/catalog/asset/inter/api/deleteAssetCatalogInter/V1', data)
}
/** 策略列表 */
export const requestStrategyList = (data: StrategyListTypes.IRequest) => {
  return request.post<IBaseResponse<StrategyListTypes.IResponse>>('/policy/requestPolicyDefinition/V1', data)
}
/** 添加策略 */
export const requestEditStrategy = (data: AddStrategyTypes.IRequest) => {
  return request.post<IBaseResponse<AddStrategyTypes.IResponse>>('/policy/putPolicyDefinition/V1', data)
}
/** 编辑策略 */
export const requestAddStrategy = (data: AddStrategyTypes.IRequest) => {
  return request.post<IBaseResponse<AddStrategyTypes.IResponse>>('/policy/postPolicyDefinition/V1', data)
}
/** 删除策略接口 */
export const requestDeleteStrategy = (data: SpaceDeleteStrategyTypes.IRequest) => {
  return request.get<IBaseResponse<SpaceDeleteStrategyTypes.IResponse>>('/policy/deletePolicyDefinition/V1', data)
}
/** 合约列表 */
export const requestContractList = (data: StrategyListTypes.IRequest) => {
  return request.post<IBaseResponse<StrategyListTypes.IResponse>>('/contract/requestContractDefinition/V1', data)
}
/** 新增合约 */
export const requestAddContract = (data: ContractAddTypes.IRequest) => {
  return request.post<IBaseResponse<ContractAddTypes.IResponse>>('/contract/postContractDefinition/V1', data)
}
/** 编辑合约 */
export const requestEditContract = (data: ContractAddTypes.IRequest) => {
  return request.post<IBaseResponse<ContractAddTypes.IResponse>>('/contract/putContractDefinition/V1', data)
}
/** 删除合约接口 */
export const requestDeleteContract = (data: SpaceDeleteStrategyTypes.IRequest) => {
  return request.get<IBaseResponse<SpaceDeleteStrategyTypes.IResponse>>('/contract/deleteContractDefinition/V1', data)
}
/** 合约记录列表 */
export const requestContractRecordListByPage = (data: ContractRecordTypes.IRequest) => {
  return request.post<IPaginationResponse<ContractRecordTypes.IResponse>>('/negotiations/v2/contractnegotiations/request', data)
}
